package com.heima.article.job;

import com.heima.article.service.HotArticleService;
import com.heima.feigns.AdminFeign;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class ComputeHotArticleJob {
    @Autowired
    HotArticleService hotArticleService;

    @XxlJob("computeHotArticleJob")
    public ReturnT<String> handle(String param) {
        log.info("定时文章热点计算任务开始...");
        //TODO 文章热点计算
        hotArticleService.computeHotArticle();
        log.info("定时文章热点计算任务结束...");
        return ReturnT.SUCCESS;
    }

}
